package lt.vu.mif.os.memory;

import lt.vu.mif.os.provider.Constants;
/**
*
* @author Antanas Rudaitis
* @author Laurynas Paradauskas
* @author Algirdas Šaltupis
* 
*/
public class Word {

    private char[] word;

    public Word() {
      this.word = new char[Constants.wordSize];
    }

    public Word(String line) {
      this.word = new char[Constants.wordSize];
      this.set(line);
    }
    
    public void set(char[] str){
        for(int i=0;i<Constants.wordSize;i++){
            if(str.length>i){
                word[i]=str[i];
            }
        }
    }

    public void set(String str){
        for(int i=0;i<str.length();i++){
            if(str.length()>i){
                word[i]=str.charAt(i);
            }
        }
    }

    public String get(){
        return new String(word);
    }

    public void print(){
        System.out.print(word);
    }
}
